<template>
	<view>
		<view class="detail borderR12 margin17">
			<view class="title">
				普通版签名码<img src="../../static/signature.png" alt="">
			</view>
			<view class="content">
				<view class="content-item">
					<view class="content-item-top">
						<view id="one">
							无限制
						</view>
					</view>
					<view class="content-item-bottom">
						可签范围
					</view>
				</view>
				<view class="content-item">
					<view class="content-item-top">
						24天
					</view>
					<view class="content-item-bottom">
						有限期
					</view>
				</view>
				<view class="content-item">
					<view class="content-item-top">
						30个
					</view>
					<view class="content-item-bottom">
						多开数量
					</view>
				</view>
			</view>
		</view>
		<!-- 选择套餐 -->
		<view class="buyTitle">请选择购买签名码套餐</view>
		<view class="margin17">
			<scroll-view scroll-x="true" show-scrollbar=false>
				<view class="scroll">
					<view class="menu checked" @tap="check(0)">
						<view class="menu-title">
							普通版签名码
						</view>
						<view class="menu-price">
							¥ 25
						</view>
						<view class="menu-des">
							<view>
								<span>18天</span>有效期
							</view>
							<view>
								<span>30个</span>多开支持
							</view>
						</view>
					</view>
					<view class="menu" @tap="check(1)">
						<view class="menu-title">
							高级版签名码
						</view>
						<view class="menu-price">
							¥ 35
						</view>
						<view class="menu-des">
							<view>
								<span>25天</span>有效期
							</view>
							<view>
								<span>40个</span>多开支持
							</view>
						</view>
					</view>
					<view class="menu" @tap="check(2)">
						<view class="menu-title">
							尊享版签名码
						</view>
						<view class="menu-price">
							¥ 40
						</view>
						<view class="menu-des">
							<view>
								<span>18天</span>有效期
							</view>
							<view>
								<span>30个</span>多开支持
							</view>
						</view>
					</view>
				</view>

			</scroll-view>
		</view>
		<!-- 购买数量 -->
		<view class="buyNumber margin17 borderR12 bgcfff padding17">
			<view>
				购买数量
			</view>
			<van-stepper v-model="value" theme="round" button-size="22" disable-input />
		</view>
		<view class="hint margin17">
			<img src="../../static/icon/hint.svg" alt="">
			<view class="">
				签名码分为多种，根据自己的需要选择合适的签名码进行购买，购买完成后，页面会展示本次所购买的签名码。
			</view>
		</view>
		<!-- 底部购买 -->
		<view class="footer bgcfff padding17">
			<view class="footer-left">
				<view class="footer-count">
					合计
				</view>
				<view class="footer-price">
					¥ 25
				</view>
			</view>
			<view class="btn">
				<button>立即购买</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				checked: ''
			}
		},
		methods: {
			// 传入序号
			check(index) {
				let menu = document.querySelectorAll('.menu')
				menu.forEach((item) => {
					item.classList.remove('checked')
				})
				menu[index].classList.add('checked')
			}
		}
	}
</script>

<style lang="scss">
	// 签名码详情
	.detail {
		display: flex;
		flex-direction: column;
		height: 354upx;
		margin-top: 40upx;
		border-radius: 14px;

		background: linear-gradient(180deg, #3A84FD 4%, #84B3FE 100%);

		.title {
			padding-left: 54upx;
			display: flex;
			flex: 1;
			align-items: center;
			font-size: 48upx;
			color: #fff;
			font-weight: bold;

			img {
				width: 42upx;
				height: 42upx;
				padding-left: 16upx;
			}
		}

		.content {
			display: flex;
			flex: 1;
			color: #fff;

			&-item {
				display: flex;
				flex: 1;
				flex-direction: column;
				align-items: center;

				#one {
					width: 160upx;
					height: 54upx;
					border-radius: 24upx;
					font-size: 28upx;
					color: #875412;
					line-height: 54upx;
					text-align: center;
					background: linear-gradient(270deg, #FFC87E 0%, #FEEBBB 127%);
				}

				&-top,
				&-bottom {
					flex: 1;
				}

				&-top {
					font-size: 48upx;
					font-weight: 700;
				}
			}
		}
	}

	.buyTitle {
		height: 32upx;
		margin-top: 40upx;
		margin-bottom: 58upx;
		font-size: 32upx;
		text-align: center;
	}

	.scroll {
		display: inline-flex;

	}

	.menu {
		position: relative;
		width: 138px;
		height: 184px;
		margin-right: 26upx;
		border-radius: 14px;
		background: #FFFFFF;
		box-sizing: border-box;
		border: 2px solid #4188FD;
		overflow: hidden;

		&-title {
			position: absolute;
			left: 0;
			top: 0;
			width: 188upx;
			height: 48upx;
			padding-left: 20upx;
			line-height: 48upx;
			color: #875412;
			font-weight: 350;
			border-top-left-radius: 24upx;
			border-bottom-right-radius: 10upx;
			background: linear-gradient(270deg, #FFC87E 0%, #FEEBBB 127%);

			&::after {
				content: '';
				position: absolute;
				width: 0;
				height: 0;
				right: 0;
				// background-color: transparent;
				border-top: 50upx solid #ffffff;
				border-left: 12upx solid transparent;
			}
		}

		&-price {
			margin-top: 120upx;
			text-align: center;
			font-size: 68upx;
			font-weight: 700;
			color: #4188FD;
		}

		&-des {
			margin-top: 40upx;
			text-align: center;
			color: #000000;

			span {
				color: #4188FD;
			}
		}
	}

	.checked {

		// position: relative;
		&::before {
			content: '';
			position: absolute;
			z-index: 10;
			width: 40upx;
			height: 40upx;
			right: 10upx;
			bottom: 12upx;
			// background-color: red;
			background-image: url('../../static/icon/check.svg');
			background-size: 100%;
		}

		&::after {
			content: '';
			position: absolute;
			width: 0;
			height: 0;
			right: 0;
			bottom: 0;
			border-top: 50px solid transparent;
			border-right: 50px solid #4188FD;
		}
	}

	.buyNumber {
		height: 140upx;
		margin-top: 40upx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-weight: 500;
	}

	/deep/.van-stepper--round .van-stepper__minus {
		color: #4188FD;
		background-color: #fff;
		border: 1px solid #4188FD;
	}

	/deep/.van-stepper--round .van-stepper__plus {
		background-color: #4188FD;
	}

	// 提示
	.hint {
		display: flex;
		margin-top: 40upx;
		padding-bottom: 160upx;
		padding-left: 20upx;
		font-size: 24upx;
		color: #B5B5B5;

		img {
			margin-bottom: 42upx;
			padding-right: 10upx;
		}
	}

	// 底部
	.footer {
		position: fixed;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		height: 144upx;
		bottom: 0;
		&-left{
			flex: 1;
		}
		&-count{
			position: absolute;
			top: 10upx;
		}
		&-price{
			margin-top:20upx;
			font-size: 64upx;
			font-weight: 700;
			color: #FC5230;
		}
		button {
			flex: 1;
			width: 368upx;
			height: 106upx;
			border-radius: 80upx;
			display: flex;
			flex-direction: row;
			justify-content: center;
			align-items: center;
			padding: 16upx 48upx;
			gap: 8upx;
			background: linear-gradient(90deg, #4189FE 13%, #7CAFFE 138%);
			font-weight: 700;
			color: #fff;
		}
	}
</style>